/*
** FileName:2903.c
** Author:Creat
** Time:下午8:06
**
**/
int* findIndices(int* nums, int numsSize, int indexDifference, int valueDifference, int* returnSize) {
    *returnSize = 2;
    int *ret = (int *)malloc(sizeof(int) * 2);
    int minIndex = 0, maxIndex = 0;
    for (int j = indexDifference; j < numsSize; j++) {
        int i = j - indexDifference;
        if (nums[i] < nums[minIndex]) {
            minIndex = i;
        }
        if (nums[j] - nums[minIndex] >= valueDifference) {
            ret[0] = minIndex;
            ret[1] = j;
            return ret;
        }
        if (nums[i] > nums[maxIndex]) {
            maxIndex = i;
        }
        if (nums[maxIndex] - nums[j] >= valueDifference) {
            ret[0] = maxIndex;
            ret[1] = j;
            return ret;
        }
    }
    ret[0] = -1;
    ret[1] = -1;
    return ret;
}